-- GENERATED SPELL FOR [Mennu the Betrayer] --


function spell0_17941(pUnit, Event) --@Corrupted Nova Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(31991,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_17941', 1, 1)
end

function spell1_17941(pUnit, Event) --@Lightning Bolt,n/a--
pUnit:FullCastSpellOnTarget(35010,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_17941', 3000, 1)
end

function spell2_17941(pUnit, Event) --@Mennu\'s Healing Ward,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(34980,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_17941', 1, 1)
end

function spell3_17941(pUnit, Event) --@Tainted Earthgrab Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(31981,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_17941', 1, 1)
end

function spell4_17941(pUnit, Event) --@Tainted Stoneskin Totem,Self--
pUnit:FullCastSpellOnTarget(31985,pUnit)
pUnit:RegisterEvent('Sorts_17941', 803, 1)
end

function Sorts_17941(pUnit, Event)
local choix_sorts_17941 = math.random(0, 4)
if choix_sorts_17941 == 0 then
pUnit:RegisterEvent('spell0_17941', 1, 1)
end
if choix_sorts_17941 == 1 then
pUnit:RegisterEvent('spell1_17941', 1, 1)
end
if choix_sorts_17941 == 2 then
pUnit:RegisterEvent('spell2_17941', 1, 1)
end
if choix_sorts_17941 == 3 then
pUnit:RegisterEvent('spell3_17941', 1, 1)
end
if choix_sorts_17941 == 4 then
pUnit:RegisterEvent('spell4_17941', 1, 1)
end
end

function mob17941_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_17941', math.random(1500, 3000), 1)
end

function mob17941_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17941_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob17941_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(17941, 1, 'mob17941_Action')
RegisterUnitEvent(17941, 2, 'mob17941_Leave')
RegisterUnitEvent(17941, 3, 'mob17941_Kill')
RegisterUnitEvent(17941, 4, 'mob17941_Die')
